import httpRequest from "@/http"
import { type MyResponseType } from "@/bean/base/response";
import { type LeftMenuGroupType } from "@/bean/menu/AllMenuType";
import { type MenuModule } from "@/bean/menu/AllMenuType";
import { type MyPageResponseType } from "@/bean/base/page";

export const getMenuApi = () => {
    return httpRequest.postNoParam<MyResponseType<Array<LeftMenuGroupType>>>("/comMenu/getMenuData");
}

export const getMenuAllApi = () => {
    return httpRequest.post<MyResponseType<Array<MenuModule>>>("/comMenu/all",{});
}


export const getMenuListApi = (params:Object) => {
    return httpRequest.post<MyResponseType<MyPageResponseType<MenuModule>>>("/comMenu/list",params);
}


export const addMenuApi = (params:Object) => {
    return httpRequest.post<MyResponseType<Object>>("/comMenu/add",params);
}


export const updateMenuApi = (params:Object) => {
    return httpRequest.post<MyResponseType<Object>>("/comMenu/update",params);
}

export const delMenuApi = (params:Object) => {
    return httpRequest.postLink<MyResponseType<Object>>(`/comMenu/delete`,params);
}
